package com.sxf.controller.blog.admin;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.context.request.ServletWebRequest;

import com.sxf.util.CookieUtils;

@Controller
@RequestMapping("blog/logout")
public class LogoutController {

	@RequestMapping("")
	public String logout(ServletWebRequest web) throws Exception {
		web.getRequest().getSession().invalidate();
		CookieUtils.deleteCookie(web.getRequest(), web.getResponse(),
				CookieUtils.USER_ID);
		return "redirect:/blog/login";
	}

}
